﻿using System;
using System.Collections.Generic;
using System.Text;

namespace LEE.EntityFrameworkCore.Extentions.Entities.Pagination
{
    public class PagingResult<T> : PagingBase
    {
        /// <summary>
        /// 总页数
        /// </summary>
        public int PageCount
        {
            get
            {
                if (Limit == 0)
                {
                    return 0;
                }
                return TotalCount % Limit == 0 ? TotalCount / Limit : TotalCount / Limit + 1;
            }
        }
        /// <summary>
        /// 数据总量
        /// </summary>
        public int TotalCount { get; set; }
        /// <summary>
        /// 查询结果
        /// </summary>
        public List<T> Items { get; set; }
    }
}
